package com.du.ssm.service;

import com.du.ssm.mapper.DepartmentMapper;
import com.du.ssm.pojo.Department;
import com.du.ssm.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : DuJiabao
 * @Project : ssm
 * @Time : 2021/4/12 15:51
 * @Desc :
 */
@Service
public class DepartmentService {
  DepartmentMapper departmentMapper;

  public int insertDepartment(Department department) {
    return departmentMapper.insertSelective(department);
  }

  public List<Department> getAllDepartments() {
    return departmentMapper.selectByExample(null);
  }

  @Autowired
  public void setDepartmentMapper(DepartmentMapper departmentMapper) {
    this.departmentMapper = departmentMapper;
  }
}
